home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 24
/
Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso
/
Aminet
/
dev
/
e
/
AEPD24.lha
/
EPD24
/
Amiga_E-Programme
/
FVList
/
FVLIST.Doc
next >
Wrap
Text File
|
1995-02-24
|
2KB
|
84 lines
Hello fellow E-users,
Here's another Object oriented class (they're growing out of the
windows lately :) for you to enjoy, use, abuse, whatever...
It's a kind of linked list.
No wait!!! I hear you mumbling already...
But this one is no ordinary linked list. It's a bit more efficient
than the usual stuff.
Instead of holding a speech about the advantages, I'll give you the
structure, so you can figure out some things for yourself.
The main handle of the list is an FVList object, which holds no node
data, but simply list-information:
it has:
child -> the first node
parent -> NIL, naturally
root -> itself
tail -> the last node, for adding nodes fast
a node is of the type FVNode, which holds no data (you should derive
data-holding nodes for yourself)
it has:
child -> next node
parent -> previous node (or root for first node)
root -> the root, the FVList handle
member functions implemented (hopefully bug-free) are:
- make(PTR TO fvlist) of fvnode
a constructor that initialises an fvnode
- make(dummyvalue) of fvlist
a constructor that initialises the root fvlist
- the root fvlist can be destructed using
END root (assuming root is the PTR TO fvlist)
, which will destruct all linked nodes, free their memory and free
the root itself including it's memory
- free() of fvnode
frees the node you call it with and all it's children, updates
the tail of the root and some other stuff, so that the list is
always valid. (I call this an amputation :)
- delete() of fvnode
discards a node from the list, linking together the pieces it
left behind, as if that node never existed. memory is freed for
that node, etc.
- giveChild() of fvnode,fvlist
echo the child
- giveParent() of fvnode,fvlist
echo the parent
- giveTail()
guess what...
- some adding function too
Hope you do something useful with it.
In the possible case that you encounter some bug(s) in it, I'd like
to hear from it definitely!
I tested it, and it seemed to work fine, but I wouldn't bet on it I
made no mistake :)
Have fun,
Frank,
hi910097@beta.ufsia.ac.be
\|/
@ @
/------------------------oOO-(_)-OOo-------------------------------\
| U |
| Oh dear.... I've got the machine that goes '..Ping..' |
\------------------------------------------------------------------/